package com.luoxiang.socialandroid.adapter;

import android.annotation.SuppressLint;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.luoxiang.socialandroid.R;
import com.luoxiang.socialandroid.bean.OfficialMessage;
import com.luoxiang.socialandroid.view.ExpandTextView3;

import java.text.SimpleDateFormat;
import java.util.List;

public class OfficialImAdapter extends BaseQuickAdapter<OfficialMessage,BaseViewHolder> {

    public OfficialImAdapter(@Nullable List<OfficialMessage> data) {
        super(R.layout.item_official_im, data);
    }

    @SuppressLint("SimpleDateFormat")
    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, OfficialMessage officialMessage) {
        baseViewHolder.setText(R.id.textTime,new SimpleDateFormat("yyyy-MM-dd hh:mm").format(officialMessage.getCreateTime()));
        baseViewHolder.setText(R.id.textTitle,officialMessage.getTitle());
        ExpandTextView3 expandTextView = baseViewHolder.getView(R.id.textContent);
        expandTextView.setText(officialMessage.getContent());
    }
}
